filelist=$1

totn=0

for ii in $(seq 0 20);
do 
    jj=$(echo $ii | awk '{print $1/10.}'); 

    if [ $ii -lt 20 ]
    then
        kk=$(echo $ii | awk '{print ($1+1)/10.}');
        pp=$(grep fBeta $filelist | grep outmn2d_post_iBeta100 | tr -s ',' ' ' | awk  '{if($16>='$jj' && $16<'$kk') print $1,$14,$15,$16}' | wc | awk '{print $1}')
        totn=$( expr $totn + $pp )
        echo $jj $kk $pp | awk '{if($3>0) printf("%3.1f %3.1f %2d\n", $1, $2, $3)}';
    else
        pp=$(grep fBeta $filelist | grep outmn2d_post_iBeta100 | tr -s ',' ' ' | awk  '{if($16>='$jj') print $1,$14,$15,$16}' | wc | awk '{print $1}')
        totn=$( expr $totn + $pp )
        echo $jj "inf" $pp | awk '{if($3>0) printf("%3.1f %s %2d\n", $1, $2, $3)}';
    fi

done

echo totn $totn
